package com.vincent.template.commons.base;

import com.vincent.template.utils.DateUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.Null;

/**
 * @Author Vincent Wang
 * @Date 2020/10/23 13:53
 */
@ApiModel(value = "BaseIncrDto", description = "基础部分(incr pk)")
public class BaseIncrDto {

    @ApiModelProperty(value = "主键ID", hidden = true)
    @Null
    private Long id;

    @ApiModelProperty(value = "创建时间", hidden = true)
    @Null
    private String createTime;

    @ApiModelProperty(value = "更新时间", hidden = true)
    @Null
    private String updateTime;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public void formatDateTime(BaseIncrEntity baseEntity) {
        this.createTime = DateUtil.formatToYmdWithTime(baseEntity.getCreateTime());
        this.updateTime = DateUtil.formatToYmdWithTime(baseEntity.getUpdateTime());
    }
}
